home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 124 / cd-rom 124.iso / edu / tuxmath / tuxmathscrabble / asymptopia / TuxManeuvers.py < prev    next >
Encoding:
Python Source  |  2003-07-26  |  23.4 KB  |  422 lines

  1. """
  2. /***************************************************************************
  3.  
  4.     Author             :Charles B. Cosse 
  5.     
  6.     Email            :ccosse@asymptopia.com
  7.                     
  8.                     
  9.     Copyright        :(C) 2002,2003 Asymptopia Software.
  10.     
  11.  ***************************************************************************/
  12. /***************************************************************************
  13.                           TuxManeuvers.py
  14.  
  15.  ***************************************************************************/
  16.  
  17. /***************************************************************************
  18.  *                                                                         *
  19.  *   This program is free software; you can redistribute it and/or modify  *
  20.  *   it under the terms of the GNU General Public License as published by  *
  21.  *   the Free Software Foundation; either version 2 of the License, or     *
  22.  *   (at your option) any later version. (Please note that if you use this *
  23.  *   code you must give credit by including the Author and Copyright       *
  24.  *   info at the top of this file).                                        *
  25.  ***************************************************************************/
  26. """
  27. import os, pygame,sys
  28. from pygame.locals import *
  29. from random import random
  30.  
  31. from Maneuvers import Maneuvers
  32. from asymptopia.myutil import *
  33.  
  34. #get path to site-packages:
  35. try:
  36.     for sitepkgdir in sys.path:
  37.         if sitepkgdir[-13:]=='site-packages':break
  38. except:pass
  39.  
  40. class TuxManeuvers(Maneuvers):
  41.     def __init__(self):
  42.         self.maneuvers={}
  43.         
  44.         pop01=load_sound(os.path.join(sitepkgdir,'asymptopia/sounds/pop01.wav'))
  45.         pop02=load_sound(os.path.join(sitepkgdir,'asymptopia/sounds/pop01.wav'))
  46.         boink=load_sound('asymptopia/sounds/bong05.wav')
  47.         
  48.  
  49.         img_walkl_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_left_01_color.gif'))
  50.         img_walkl_02=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_left_02_color.gif'))
  51.         img_walkl_03=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_left_03_color.gif'))
  52.         img_walkl_04=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_left_04_color.gif'))
  53.         walkl=[
  54.             {'img':img_walkl_02,'snd':pop02,'dx':-15,'dy':-8,'timeout':.1},
  55.             {'img':img_walkl_03,'snd':pop01,'dx':-15,'dy':8,'timeout':.1},
  56.             {'img':img_walkl_04,'snd':pop02,'dx':-15,'dy':-8,'timeout':.1},
  57.             {'img':img_walkl_01,'snd':pop01,'dx':-15,'dy':8,'timeout':.1},
  58.         ]
  59.         
  60.         img_walkr_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_right_01_color.gif'))
  61.         img_walkr_02=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_right_02_color.gif'))
  62.         img_walkr_03=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_right_03_color.gif'))
  63.         img_walkr_04=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/walk_right_04_color.gif'))
  64.         walkr=[
  65.             {'img':img_walkr_02,'snd':pop02,'dx':+15,'dy':8,'timeout':.1},
  66.             {'img':img_walkr_03,'snd':pop01,'dx':+15,'dy':-8,'timeout':.1},
  67.             {'img':img_walkr_04,'snd':pop02,'dx':+15,'dy':8,'timeout':.1},
  68.             {'img':img_walkr_01,'snd':pop01,'dx':+15,'dy':-8,'timeout':.1},
  69.         ]
  70.         
  71.         img_scratchl_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/scratch_left_01.gif'))
  72.         img_scratchl_02=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/scratch_left_02.gif'))
  73.         scratchl=[
  74.             {'img':img_scratchl_01,'snd':None,'dx':0,'dy':0,'timeout':0},
  75.             {'img':img_scratchl_02,'snd':None,'dx':0,'dy':0,'timeout':0},
  76.         ]
  77.         
  78.         img_scratchr_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/scratch_right_01.gif'))
  79.         img_scratchr_02=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/scratch_right_02.gif'))
  80.         scratchr=[
  81.             {'img':img_scratchr_01,'snd':None,'dx':0,'dy':0,'timeout':0},
  82.             {'img':img_scratchr_02,'snd':None,'dx':0,'dy':0,'timeout':0},
  83.         ]
  84.         
  85.         
  86.         
  87.         #i_am_stumped.gif
  88.         #nice_move.gif
  89.         #thinking.gif
  90.         #your_move.gif
  91.         #ok.gif
  92.         #stand_front_look_left.gif
  93.         #stand_front_look_right.gif
  94.         #stand_left_look_front.gif
  95.         #stand_left_look_front_neck_stretch.gif
  96.         #stand_right_look_front.gif
  97.         #stand_right_look_front_neck_stretch.gif
  98.         
  99.         img_forehead_slap_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_01_color.gif'))
  100.         img_forehead_slap_02=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_02_color.gif'))
  101.         img_forehead_slap_03=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_03_color.gif'))
  102.         img_forehead_slap_04=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_04_color.gif'))
  103.         img_forehead_slap_05=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_05_color.gif'))
  104.         img_forehead_slap_06=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_06_color.gif'))
  105.         img_forehead_slap_07=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_07_color.gif'))
  106.         img_forehead_slap_08=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_08_color.gif'))
  107.         img_forehead_slap_09=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_09_color.gif'))
  108.         img_forehead_slap_10=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/forehead_slap_10_color.gif'))
  109.         forehead_slap=[
  110.             {'img':img_forehead_slap_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  111.             {'img':img_forehead_slap_02,'snd':None,'dx':0,'dy':0,'timeout':.1},
  112.             {'img':img_forehead_slap_03,'snd':None,'dx':0,'dy':0,'timeout':.1},
  113.             {'img':img_forehead_slap_04,'snd':None,'dx':0,'dy':0,'timeout':.1},
  114.             {'img':img_forehead_slap_05,'snd':None,'dx':0,'dy':0,'timeout':.1},
  115.             {'img':img_forehead_slap_05,'snd':None,'dx':0,'dy':0,'timeout':.1},
  116.             {'img':img_forehead_slap_05,'snd':None,'dx':0,'dy':0,'timeout':.1},
  117.             {'img':img_forehead_slap_05,'snd':None,'dx':0,'dy':0,'timeout':.1},
  118.             {'img':img_forehead_slap_05,'snd':None,'dx':0,'dy':0,'timeout':.1},
  119.             {'img':img_forehead_slap_06,'snd':None,'dx':0,'dy':0,'timeout':.1},
  120.             {'img':img_forehead_slap_08,'snd':None,'dx':0,'dy':0,'timeout':.1},
  121.             {'img':img_forehead_slap_09,'snd':None,'dx':0,'dy':0,'timeout':.1},
  122.             {'img':img_forehead_slap_10,'snd':None,'dx':0,'dy':0,'timeout':.1},
  123.         ]
  124.         
  125.         img_big_flapper_00=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/big_flapper_00.gif'))
  126.         img_big_flapper_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/big_flapper_01.gif'))
  127.         big_flapper=[
  128.             {'img':img_big_flapper_01,'snd':pop02,'dx':0,'dy':20,'timeout':.1},
  129.             {'img':img_big_flapper_00,'snd':pop01,'dx':0,'dy':-20,'timeout':.1},
  130.         ]
  131.         img_stand_left_01=img_walkl_01
  132.         img_stand_right_01=img_walkr_01
  133.         
  134.         img_stand_front_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/stand_front_01.gif'))
  135.         stand_front=[
  136.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':0.},
  137.         ]
  138.         img_stand_front_look_left=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/stand_front_look_left.gif'))
  139.         stand_front_look_left=[
  140.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':0.},
  141.             {'img':img_stand_front_look_left,'snd':None,'dx':0,'dy':0,'timeout':0.5},
  142.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':0.},
  143.         ]
  144.         img_stand_front_look_right=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/stand_front_look_right.gif'))
  145.         stand_front_look_right=[
  146.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  147.             {'img':img_stand_front_look_right,'snd':None,'dx':0,'dy':0,'timeout':0.5},
  148.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  149.         ]
  150.         img_stand_left_look_front=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/stand_left_look_front.gif'))
  151.         stand_left_look_front=[
  152.             {'img':img_stand_left_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  153.             {'img':img_stand_left_look_front,'snd':None,'dx':0,'dy':0,'timeout':1.},
  154.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  155.         ]
  156.         img_stand_right_look_front=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/stand_right_look_front.gif'))
  157.         stand_right_look_front=[
  158.             {'img':img_stand_right_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  159.             {'img':img_stand_right_look_front,'snd':None,'dx':0,'dy':0,'timeout':1.},
  160.             {'img':img_stand_right_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  161.         ]
  162.         img_stand_left_look_front_neck_stretch=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/stand_left_look_front_neck_stretch.gif'))
  163.         stand_left_look_front_neck_stretch=[
  164.             {'img':img_stand_left_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  165.             {'img':img_stand_left_look_front_neck_stretch,'snd':None,'dx':0,'dy':0,'timeout':1.},
  166.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  167.         ]
  168.         img_stand_right_look_front_neck_stretch=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/stand_right_look_front_neck_stretch.gif'))
  169.         stand_right_look_front_neck_stretch=[
  170.             {'img':img_stand_right_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  171.             {'img':img_stand_right_look_front_neck_stretch,'snd':None,'dx':0,'dy':0,'timeout':1.},
  172.             {'img':img_stand_right_01,'snd':None,'dx':0,'dy':0,'timeout':0.1},
  173.         ]
  174.     
  175.     
  176.         hop_in_place=[
  177.             {'img':img_stand_front_01,'snd':pop01,'dx':0,'dy':-10,'timeout':.1},
  178.             {'img':img_stand_front_01,'snd':pop02,'dx':0,'dy':10,'timeout':.1},
  179.         ]
  180.         
  181.         img_lean_right_fwd=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/lean_right_fwd.gif'))
  182.         img_lean_right_bck=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/lean_right_bck.gif'))
  183.         img_lean_left_fwd=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/lean_left_fwd.gif'))
  184.         img_lean_left_bck=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/lean_left_bck.gif'))
  185.         hop_right=[
  186.             {'img':img_lean_right_fwd,'snd':None,'dx':0,'dy':0,'timeout':.1},
  187.             {'img':img_lean_right_fwd,'snd':None,'dx':5,'dy':-10,'timeout':.01},
  188.             {'img':img_lean_right_fwd,'snd':None,'dx':5,'dy':-6,'timeout':.01},
  189.             {'img':img_lean_right_fwd,'snd':None,'dx':5,'dy':-5,'timeout':.01},
  190.             {'img':img_lean_right_fwd,'snd':None,'dx':5,'dy':-1,'timeout':.01},
  191.             {'img':img_lean_right_fwd,'snd':None,'dx':5,'dy':0,'timeout':.01},
  192.             {'img':img_lean_right_fwd,'snd':None,'dx':5,'dy':0,'timeout':.01},
  193.             {'img':img_stand_right_01,'snd':None,'dx':15,'dy':1,'timeout':.01},
  194.             {'img':img_stand_right_01,'snd':None,'dx':15,'dy':5,'timeout':.01},
  195.             {'img':img_lean_right_bck,'snd':None,'dx':15,'dy':6,'timeout':.01},
  196.             {'img':img_lean_right_bck,'snd':None,'dx':10,'dy':10,'timeout':.01},
  197.             {'img':img_lean_right_bck,'snd':None,'dx':0,'dy':0,'timeout':.1},
  198.             {'img':img_stand_right_01,'snd':boink,'dx':0,'dy':0,'timeout':.2},
  199.         ]
  200.         hop_left=[
  201.             {'img':img_lean_left_fwd,'snd':None,'dx':0,'dy':0,'timeout':.1},
  202.             {'img':img_lean_left_fwd,'snd':None,'dx':-5,'dy':-10,'timeout':.01},
  203.             {'img':img_lean_left_fwd,'snd':None,'dx':-5,'dy':-6,'timeout':.01},
  204.             {'img':img_lean_left_fwd,'snd':None,'dx':-5,'dy':-5,'timeout':.01},
  205.             {'img':img_lean_left_fwd,'snd':None,'dx':-5,'dy':-1,'timeout':.01},
  206.             {'img':img_lean_left_fwd,'snd':None,'dx':-5,'dy':0,'timeout':.01},
  207.             {'img':img_lean_left_fwd,'snd':None,'dx':-5,'dy':0,'timeout':.01},
  208.             {'img':img_stand_left_01,'snd':None,'dx':-15,'dy':1,'timeout':.01},
  209.             {'img':img_stand_left_01,'snd':None,'dx':-15,'dy':5,'timeout':.01},
  210.             {'img':img_lean_left_bck,'snd':None,'dx':-15,'dy':6,'timeout':.01},
  211.             {'img':img_lean_left_bck,'snd':None,'dx':-10,'dy':10,'timeout':.01},
  212.             {'img':img_lean_left_bck,'snd':None,'dx':0,'dy':0,'timeout':.1},
  213.             {'img':img_stand_left_01,'snd':boink,'dx':0,'dy':0,'timeout':.2},
  214.         ]
  215.         
  216.         hopflap_left=[
  217.                 {'img':img_big_flapper_00,'snd':pop02,'dx':-5,'dy':-10,'timeout':0.09},
  218.                 {'img':img_big_flapper_01,'snd':pop01,'dx':0,'dy':10,'timeout':0.09},
  219.         ]
  220.         hopflap_right=[
  221.                 {'img':img_big_flapper_00,'snd':pop02,'dx':5,'dy':-10,'timeout':0.09},
  222.                 {'img':img_big_flapper_01,'snd':pop01,'dx':0,'dy':10,'timeout':0.09},
  223.         ]
  224.         
  225.         img_yougofirst_00=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/yougofirst_00.gif'))
  226.         you_go_first=[
  227.             {'img':img_yougofirst_00,'snd':None,'dx':0,'dy':0,'timeout':0.},
  228.         ]
  229.         
  230.         img_himathlover_00=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/himathlover_00.gif'))
  231.         img_himathlover_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/himathlover_01.gif'))
  232.         hi_math_lover=[
  233.             {'img':img_himathlover_00,'snd':None,'dx':0,'dy':0,'timeout':.1},
  234.             {'img':img_himathlover_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  235.         ]
  236.         
  237.         img_head_tilt_left_00=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/head_tilt_left_00.gif'))
  238.         img_head_tilt_left_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/head_tilt_left_01.gif'))
  239.         head_tilt_left=[
  240.             {'img':img_head_tilt_left_00,'snd':None,'dx':0,'dy':0,'timeout':.1},
  241.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  242.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  243.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  244.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  245.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  246.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  247.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  248.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  249.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  250.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  251.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  252.             {'img':img_head_tilt_left_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  253.             {'img':img_head_tilt_left_00,'snd':None,'dx':0,'dy':0,'timeout':.1},
  254.         ]
  255.         
  256.         img_head_tilt_right_00=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/head_tilt_right_00.gif'))
  257.         img_head_tilt_right_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/head_tilt_right_01.gif'))
  258.         head_tilt_right=[
  259.             {'img':img_head_tilt_right_00,'snd':None,'dx':0,'dy':0,'timeout':.1},
  260.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  261.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  262.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  263.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  264.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  265.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  266.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  267.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  268.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  269.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  270.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  271.             {'img':img_head_tilt_right_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  272.             {'img':img_head_tilt_right_00,'snd':None,'dx':0,'dy':0,'timeout':.1},
  273.         ]
  274.         
  275.         img_neck_stretch_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/neck_stretch_01.gif'))
  276.         img_neck_squash_01=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/neck_squash_01.gif'))
  277.         img_neck_squash_tilt_left=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/neck_squash_tilt_left.gif'))
  278.         img_neck_squash_tilt_right=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/neck_squash_tilt_right.gif'))
  279.         neck_stretch=[
  280.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  281.             {'img':img_neck_stretch_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  282.         ]
  283.         neck_squash=[
  284.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  285.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  286.         ]
  287.         neck_squash_tilt_lr=[
  288.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  289.             {'img':img_neck_squash_tilt_left,'snd':None,'dx':0,'dy':0,'timeout':.1},
  290.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  291.             {'img':img_neck_squash_tilt_right,'snd':None,'dx':0,'dy':0,'timeout':.1},
  292.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  293.         ]
  294.         
  295.         neck_squash_tilt_l=[
  296.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  297.             {'img':img_neck_squash_tilt_left,'snd':None,'dx':0,'dy':0,'timeout':.1},
  298.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  299.         ]
  300.         neck_squash_tilt_r=[
  301.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  302.             {'img':img_neck_squash_tilt_right,'snd':None,'dx':0,'dy':0,'timeout':.1},
  303.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  304.         ]
  305.         
  306.         neck_squash_hop_in_place=[
  307.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':0,'timeout':.1},
  308.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':-10,'timeout':.1},
  309.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':10,'timeout':.1},
  310.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':-10,'timeout':.1},
  311.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':10,'timeout':.1},
  312.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':-10,'timeout':.1},
  313.             {'img':img_neck_squash_01,'snd':None,'dx':0,'dy':10,'timeout':.1},
  314.             {'img':img_stand_front_01,'snd':None,'dx':0,'dy':00,'timeout':.1},
  315.         ]
  316.         
  317.         img_am_stumped=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/i_am_stumped.gif'))
  318.         i_am_stumped=[
  319.             {'img':img_am_stumped,'snd':None,'dx':0,'dy':0,'timeout':.05},
  320.         ]
  321.         img_skater=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/skate_right.gif'))
  322.         skate_right=[
  323.             {'img':img_skater,'snd':None,'dx':15,'dy':0,'timeout':0},
  324.         ]
  325.         skate_right_slower=[
  326.             {'img':img_skater,'snd':None,'dx':9,'dy':0,'timeout':0},
  327.         ]
  328.         
  329.         img_skatel=pygame.image.load(os.path.join(sitepkgdir,'./asymptopia/anim_images/skate_left.gif'))
  330.         skate_left=[
  331.             {'img':img_skatel,'snd':None,'dx':-15,'dy':0,'timeout':0},
  332.         ]
  333.         skate_left_slower=[
  334.             {'img':img_skatel,'snd':None,'dx':-9,'dy':0,'timeout':0},
  335.         ]
  336.  
  337.         self.sequences={
  338.             'walkl':walkl,'walkr':walkr,'scratchr':scratchr,'scratchl':scratchl,'forehead_slap':forehead_slap,
  339.             'big_flapper':big_flapper,'stand_front':stand_front,'hop_in_place':hop_in_place,
  340.             'hopflap_left':hopflap_left,'hopflap_right':hopflap_right,
  341.             'you_go_first':you_go_first,'hi_math_lover':hi_math_lover,
  342.             'head_tilt_left':head_tilt_left,'head_tilt_right':head_tilt_right,
  343.             'neck_stretch':neck_stretch,
  344.             'neck_squash':neck_squash,'neck_squash_tilt_lr':neck_squash_tilt_lr,
  345.             'neck_squash_tilt_l':neck_squash_tilt_l,'neck_squash_tilt_r':neck_squash_tilt_r,
  346.             
  347.             'stand_front_look_left':stand_front_look_left,
  348.             'stand_front_look_right':stand_front_look_right,
  349.             'stand_left_look_front':stand_left_look_front,
  350.             'stand_right_look_front':stand_right_look_front,
  351.             'stand_left_look_front_neck_stretch':stand_left_look_front_neck_stretch,
  352.             'stand_right_look_front_neck_stretch':stand_right_look_front_neck_stretch,
  353.             'hop_right':hop_right,
  354.             'hop_left':hop_left,
  355.             'neck_squash_hop_in_place':neck_squash_hop_in_place,
  356.             'i_am_stumped':i_am_stumped,
  357.             'skate_right':skate_right,
  358.             'skate_right_slower':skate_right_slower,
  359.             'skate_left':skate_left,
  360.             'skate_left_slower':skate_left_slower,
  361.             
  362.         }
  363.         
  364.         
  365.         self.defineManeuver('look_left_maneuver',[{'stand_front_look_left':(-999,0)}])
  366.         self.defineManeuver('look_right_maneuver',[{'stand_front_look_right':(-999,0)}])
  367.         self.defineManeuver('insist_yougofirst_maneuver',[{'you_go_first':(-999,1)},])
  368.         self.defineManeuver('return_stumped_maneuver',[{'i_am_stumped':(-999,10)},{'walkr':(730,100)},{'stand_front':(-999,0)},])
  369.         
  370.         
  371.         self.defineManeuver('tux_welcome_maneuver_01',[{'stand_front':(-999,10)},{'hi_math_lover':(-999,10)},{'walkr':(730,100)},{'stand_front':(-999,1)},{'you_go_first':(-999,15)},{'stand_front':(-999,1)},])
  372.         self.defineManeuver('tux_welcome_maneuver_02',[{'stand_front':(-999,10)},{'hi_math_lover':(-999,10)},{'hop_right':(730,100)},{'stand_front':(-999,1)},{'you_go_first':(-999,15)},{'stand_front':(-999,1)},])
  373.         
  374.         self.defineManeuver('forehead_slap_maneuver',[{'forehead_slap':(-999,0)},{'stand_front':(-999,0)}])
  375.         self.defineManeuver('tux_get_up_maneuver_01',[{'walkl':(200,100)},{'scratchl':(-999,1)},])
  376.         self.defineManeuver('tux_get_up_maneuver_02',[{'walkl':(400,100)},{'skate_left':(200,100)},{'scratchr':(-999,1)},])
  377.         self.defineManeuver('tux_get_up_maneuver_03',[{'skate_left':(400,100)},{'walkl':(200,100)},{'scratchl':(-999,1)},])
  378.         self.defineManeuver('tux_get_up_maneuver_04',[{'skate_left_slower':(400,100)},{'hop_left':(200,100)},{'neck_stretch':(-999,0)},])
  379.         self.defineManeuver('tux_get_up_maneuver_04',[{'hop_left':(400,100)},{'skate_left':(200,100)},{'stand_left_look_front_neck_stretch':(-999,0)},])
  380.  
  381.         self.defineManeuver('return_skating_maneuver',[{'stand_front':(-999,0)},{'skate_right':(730,100)},{'stand_front':(-999,0)}])
  382.         self.defineManeuver('return_skating_slower_maneuver',[{'stand_front':(-999,0)},{'skate_right_slower':(730,100)},{'stand_front':(-999,0)}])
  383.         self.defineManeuver('tux_go_back_from_tray_maneuver_01',[{'walkr':(730,100)},{'stand_right_look_front_neck_stretch':(-999,0)},{'stand_front':(-999,0)},])
  384.         self.defineManeuver('tux_go_back_from_tray_maneuver_02',[{'hop_right':(330,100)},{'skate_right':(730,100)},{'stand_right_look_front':(-999,0)},{'stand_front':(-999,0)},])
  385.  
  386.         self.defineManeuver('tux_hop_back_from_tray_maneuver',[{'hopr':(730,100)},{'stand_front':(-999,0)},{'head_tilt_left':(-999,0)},{'stand_front':(-999,0)}])
  387.         self.defineManeuver('one_scratchl_maneuver',[{'scratchl':(-999,1)},{'stand_front':(-999,0)}])
  388.         self.defineManeuver('one_scratchr_maneuver',[{'scratchr':(-999,1)},{'stand_front':(-999,0)}])
  389.         self.defineManeuver('tux_flapper_maneuver',[{'big_flapper':(-999,3)},{'stand_front':(-999,0)}])
  390.         self.defineManeuver('hopflap_left_maneuver',[{'hopflap_left':(650,100)},{'stand_front':(-999,0)}])
  391.         self.defineManeuver('hopflap_right_maneuver',[{'hopflap_right':(730,100)},{'stand_front':(-999,0)}])
  392.         self.defineManeuver('hopflap_leftright_maneuver',[{'hopflap_left':(650,100)},{'hopflap_right':(730,100)},{'stand_front':(-999,1)}])
  393.         self.defineManeuver('head_tilt_left_maneuver',[{'head_tilt_left':(-999,0)}])
  394.         self.defineManeuver('head_tilt_right_maneuver',[{'head_tilt_right':(-999,0)}])
  395.         self.defineManeuver('hop_in_place_maneuver',[{'hop_in_place':(-999,2)}])
  396.         self.defineManeuver('neck_squash_hop_in_place_maneuver',[{'neck_squash_hop_in_place':(-999,0)}])
  397.         
  398.         self.defineManeuver('neck_stretch_maneuver',[{'neck_stretch':(-999,1)}])
  399.         self.defineManeuver('neck_squash_maneuver',[{'neck_squash':(-999,1)}])
  400.         self.defineManeuver('neck_squash_tiltleftright_maneuver',[{'neck_squash_tilt_lr':(-999,0)}])
  401.         self.defineManeuver('neck_squash_tiltleft_maneuver',[{'neck_squash_tilt_l':(-999,0)}])
  402.         self.defineManeuver('neck_squash_tiltright_maneuver',[{'neck_squash_tilt_r':(-999,0)}])
  403.         self.defineManeuver('neck_stretch_hopinplace_maneuver',[{'neck_stretch':(-999,1)},{'hop_in_place':(-999,1)},{'neck_stretch':(-999,1)},])
  404.         self.defineManeuver('walkoff_stage_right_maneuver',[{'walkr':(1100,100)},{'stand_front':(-999,10)},{'walkl':(730,100)},{'neck_stretch':(-999,1)},{'stand_front':(-999,0)}])
  405.         
  406.         
  407.     def defineManeuver(self,maneuver_name,seqlist):
  408.         self.maneuvers[maneuver_name]=seqlist
  409.             
  410.     def getSequencesPyld(self):
  411.         return(self.sequences)
  412.         
  413.     def getManeuversPyld(self):
  414.         return(self.maneuvers)
  415.     
  416.     def getManeuverNames(self):
  417.         #not currently called for Tux -- his are hardcoded. this func for random tile anims.
  418.         maneuver_names=[]
  419.         for key in self.maneuvers.keys():
  420.             maneuver_names.append(key)
  421.         return(maneuver_names)
  422.